The present invention relates to a branch history table (BHT) write control system for controlling writing into a branch history table in an advanced-control type data processor.
When executing a branch instruction, generally the advanced control of the branch destination address determines the performance of the data processor. For this reason, taking note of the fact that the branching direction frequently is the same as the result of a branch prediction executed in the past, there is proposed a technique by which a branch instruction address and an executed-branch-destination-address are stored in a pair in a BHT and the branch instruction address is identified by searching the BHT without having to calculate the branch destination address. For details of this technique, reference may be made to the U.S. Pat. Nos. 3,559,183 and 4,604,691.
Into this BHT is stored a branch destination address identified at the arithmetic execution stage of a branch instruction. Searching of this BHT is done at the instruction prefetch stage preceding the arithmetic execution stage.
Where an instruction stream consisting of a sequence of instructions is to be subjected to advanced control, registration in the BHT by a foregoing instruction and searching of the BHT by a subsequent instruction are in conflict with each other. A random access memory for realizing a BHT usually does not permit searching during registration. For this reason, where the branch instruction is loop-conscious, as is a branch-on-count (BCT)-instruction, there is the disadvantage that the instruction prefetching action of a stream including a branch instruction, depending on the number of loopable instructions in the stream, comes into conflict with the registering action into the BHT, the latter being given priority to prevent searching of the BHT.